/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package TabelModel;

import Com.TransaksiParkirdanLaporan.Com.Transaksi.DataParkir;
import java.util.ArrayList;
import java.util.List;
import javax.swing.table.AbstractTableModel;

/**
 *
 * @author Tea-Nose
 */
public class DataParkir_TableModel extends AbstractTableModel {

    private List<DataParkir> dataparkirz = new ArrayList<DataParkir>();

    public DataParkir_TableModel(List<DataParkir> dataparkirz) {
        this.dataparkirz = dataparkirz;
    }

    public int getRowCount() {
        return dataparkirz.size();
    }

    public int getColumnCount() {
        return 7;
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        DataParkir dataParkir = dataparkirz.get(rowIndex);
        switch (columnIndex) {
            case 0:
                return dataParkir.getNoParkir();
            case 1:
                return dataParkir.getNoPolisiKendaraan();
            case 2:
                return dataParkir.getJumlahHelm();
            case 3:
                return dataParkir.getKode_merkHelm_jenisHelm();
            case 4:
                return dataParkir.getTanggalMasuk();
            case 5:
                return dataParkir.getJamMasuk();
            case 6:
                return dataParkir.getBiaya_parkir();
          
            default:
                return "";
        }
    }

    public String getColumnName(int coloumn) {
        switch (coloumn) {
            case 0:
                return "No Parkir";
            case 1:
                return "No Polisi Kendaraan";
            case 2:
                return "Jumlah Helm";
            case 3:
                return "Kode Helm";
            case 4:
                return "Tanggal Masuk";
            case 5:
                return "Jam Masuk";

            case 6:
                return "Biaya Parkir";
            default:
                return "";
        }
    }
}
